<%@page contentType="text/html; charset=utf-8" %>
<%@ include file="/commons/taglibs.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<link href="${ctx}/styles/aux_window.css" rel="stylesheet" type="text/css">
<%@ include file="/commons/validation.jsp" %>
<%@ include file="/commons/fileUpload.jsp" %>
<script type="text/javascript" src="${ctx}/scripts/public.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script type="text/javascript" src="${ctx}/scripts/div/common.js"></script>
<script type="text/javascript">
	var formSerial = null;
	/****关闭窗体前，检查下是否有数据更改****/
	function window_close (){
		var tempFromSerial = $("environmentEdit").serialize();
		//如果没有数据更改 ，直接关闭；否则提示是否保存
		if(tempFromSerial == formSerial){
			closeWindowWithoutCondition();
			return;
		}
		AskConfirmTwo("${key.tipsForCloseWindow}","projectEnvironmentEditFrame","windowSave","closeWindowWithoutCondition")
	}
	/***窗体级保存(保存后，返回当前页，然后关闭)****/
	function windowSave(){
		setIsEdit();
		save();
	}
	/*****保存数据*******/
	function save (){
		var flag = document.forms('environmentEdit').fireEvent("onSubmit");
		if(!flag) return;
		document.forms('environmentEdit').submit();
	}
	/*****不带任何条件的删除*******/
	function closeWindowWithoutCondition(){
		windowClose();
	}

	/*****设置保存标识********/
	function setIsEdit(){
		$('isSave').value = "isSave";
	}
	function init(){
		<c:if test="${!empty isSave}">
			<c:if test="${empty isArea}">
				findFrame('projectAddFrameId').tabOption.flushTab();
			</c:if>
			<c:if test="${!empty isArea}">
				findFrame('areaBaseEditFrameid').tabOption.flushTab();
			</c:if>
			windowClose();
			return;
		</c:if>

		formSerial = $("environmentEdit").serialize();
	}
</script>
</head>

<body onload="init();">
<form id="environmentEdit" name="environmentEdit" action="${ctx}/house_projectAction.do?method=editEnvironment" method="post"  ENCTYPE="multipart/form-data" class="required-validate" >
<input id="isSave" name="isSave" type="hidden" value="">
<input id="keyword" name="keyword" type="hidden" value="${environmentVO.keyword}">
<input id="projectId" name="projectId" type="hidden" value="${environmentVO.projectId}">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td class="window_head_outBg"><table border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><img src="${ctx}/images/ico_Advance.gif" width="16" height="16" align="absmiddle"> <span class="window_head_intext">${key.projectEnvironmentEdit}</span></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td class="aux_header_line_1"></td>
  </tr>
  <tr>
    <td class="aux_header_line_2"></td>
  </tr>
  <tr>
    <td valign="middle" class="content"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="container_in_show">
      <tr>
        <td valign="top">
        <div id="tab_Search" >
              <table width="100%" border="0" cellpadding="0" cellspacing="0" id="tab_subMenu1">
                <tr>
                  <td><table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">

                      <tr>
                        <td><table width="100%" border="0" cellpadding="0" cellspacing="1" class="aux_intable_color">

                          <tr>
                            <td class="aux_intable_td1">${key.projectEnvironmentName}</td>
                            <td class="aux_intable_require"><input name="name" value="${environmentVO.name}" type="text"  relativeId="keyword" class="required validate-ajax" validateUrl="${ctx}/house_projectAction.do?method=validateEnvironmentName" validateMessage="${key.projectEnvironmentValidateName}" maxlength="50" size="16"></td>
                          </tr>
                          <tr>
                            <td valign="top" class="aux_intable_td1">${key.projectEnvironmentDescription}</td>
                            <td class="aux_intable_td2"><textarea name="description"  cols="30" rows="4" class="textareatext" >${environmentVO.description}</textarea></td>
                          </tr>
                          <tr>
                            <td valign="top" class="aux_intable_td1">${key.projectEnvironmentIchnographysImage}</td>
	                            <td class="aux_intable_td2">
	                            	<mypms:ImageUpload name="ichnographysImage"
	                            					   postfixName="ichnographysImage"
	                            					   maxNum="1"
													   data="${environmentVO.ichnographysImage}"
													   imageType="jpg,gif"
													   maxSize="500"
	                            					   >
	                            	</mypms:ImageUpload>
	                		   </td>
                          </tr>
                          <tr>
                            <td valign="top" class="aux_intable_td1">${key.projectEnvironmentVisionImage}</td>
                            <td class="aux_intable_td2">
	                            	<mypms:ImageUpload name="visionImage"
	                            					   postfixName="visionImage"
	                            					   maxNum="1"
	                            					   data="${environmentVO.visionImage}"
													   imageType="jpg,gif"
													   maxSize="500"
	                            					   >
	                            	</mypms:ImageUpload>
                          </tr>
                        </table></td>
                      </tr>

                  </table></td>
                </tr>
              </table>

			</div>

		  </td>
      </tr>
    </table>

	</td>
  </tr>
  <tr>
    <td class="window_footer">
    <table border="0" cellpadding="0" cellspacing="0">
      <tr>
 <td><table border="0" cellpadding="0" cellspacing="0" >
            <tr>
			  <td></td>
	         <td class="btn_between_space"></td>
	              <td class="buttonOffLeft" id="btn1_21"></td>
	              <td class="buttonOffMiddle" id="btn1_22" onblur="btn_change(2)" onMouseOver="btn_change_over(2)" onMouseOut="btn_change_out(2)" onClick="windowSave();">
	              	<img src="${ctx}/images/ico_ok.gif" border="0" align="absmiddle" />${key.save}</td>
	              <td class="buttonOffRight" id="btn1_23"></td>
	            </tr>
	        </table></td>
        <td class="btn_between_space"></td>
        <td><table border="0" cellpadding="0" cellspacing="0" >
            <tr>
              <td class="buttonOffLeft" id="btn1_31"></td>
              <td class="buttonOffMiddle" id="btn1_32" onblur="btn_change(3)" onMouseOver="btn_change_over(3)" onMouseOut="btn_change_out(3)" onClick="window_close();">
              	<img src="${ctx}/images/ico_cancel.gif" border="0" align="absmiddle" />${key.close}
              </td>
              <td class="buttonOffRight" id="btn1_33"></td>
            </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
</form>
</body>
</html>